<template>
<div>
<v-row>
<v-col cols="12" md="6">
<v-card>
<v-card-title class="headline">学生信息</v-card-title>

<v-list>
<v-list-item>
    <v-list-item-content>
        <v-avatar size="125" tile>
            <v-img :src="form.imgurl"></v-img>
        </v-avatar>
    </v-list-item-content>
</v-list-item>
<v-list-item>
    <v-list-item-content>学号:</v-list-item-content>
    <v-list-item-content>{{form.id}}</v-list-item-content>
</v-list-item>
<v-list-item>
    <v-list-item-content>姓名:</v-list-item-content>
    <v-list-item-content>{{ form.name }}</v-list-item-content>
</v-list-item>
<v-list-item>
    <v-list-item-content>出生日期:</v-list-item-content>
    <v-list-item-content>{{form.birth}}</v-list-item-content>
</v-list-item>
<v-list-item>
    <v-list-item-content>班级:</v-list-item-content>
    <v-list-item-content>{{form.mclass}}</v-list-item-content>
</v-list-item>
<v-list-item>
    <v-list-item-content>联系方式:</v-list-item-content>
    <v-list-item-content>{{form.tel}}</v-list-item-content>
</v-list-item>
</v-list>
</v-card>
</v-col>
<v-col cols="12" md="6">
    <v-card>
        <v-card-title class="headline">成绩</v-card-title>
        <v-list>
            <v-list-item v-for="(item, i) in grade" :key="i">
                <v-list-item-content>{{item.cname}}</v-list-item-content>
                <v-list-item-content>{{item.grade}}</v-list-item-content>
            </v-list-item>
        </v-list>
    </v-card>
</v-col>
</v-row>

</div>
</template>

<script>
export default {
    name: "StudentMsgShower",

    data: ()=>({
        id: "",
        form: {
            id: "",
            name: "",
            birth: "",
            tel: "",
            mclass : "",
            imgurl: "",
        },
        grade: [{cname: "wwcc", grade: 100}],
    }),


    methods: {

    },

    created() {
        this.id = this.$route.query.id
        this.$axios.post("/api/GetStudent.php", "id="+this.id)
        .then((res)=>{
            console.log(res)
            this.form = res.data[0]
            this.form.imgurl = "/api/"+this.form.imgurl
            this.grade = res.data[1]
        }).catch((e)=>{

        })
    }
}
</script>

<style scoped>

</style>